package cn.source.zk.service.impl;

import cn.source.zk.domain.dto.BaseData2TableDTO;
import cn.source.zk.domain.entity.DbWave;
import cn.source.zk.domain.vo.Wave2PageVO;
import cn.source.zk.mapper.DbWaveMapper;
import cn.source.zk.service.DbWaveService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shiqi
 * @create 2025-05-22 15:13
 */
@Service
@Slf4j
public class DbWaveServiceImpl implements DbWaveService {

    @Autowired
    private DbWaveMapper dbWaveMapper;

    @Override
    public List<Wave2PageVO> getWaveByPage(BaseData2TableDTO baseData2TableDTO) {
        List<Wave2PageVO> list = dbWaveMapper.getWaveByPage(baseData2TableDTO);

        // ArrayList<Wave2PageVO> wave2PageVOS = new ArrayList<>();

        return list;
    }

    @Override
    public DbWave getWaveByTdGuid(String tdGuid, String formattedDateTime) {
        DbWave dbWave = dbWaveMapper.getWaveByTdGuid(tdGuid,formattedDateTime);

        if (dbWave == null || dbWave.getWave() == null) {
            return null;
        }

        return dbWave;
    }
}
